<?php

declare (strict_types=1);
namespace App\Model;

use Hyperf\Database\Model\SoftDeletes;
use Hyperf\DbConnection\Model\Model;
/**
 * @property int $id 
 * @property int $user_id 
 * @property int $paper_id 
 * @property \Carbon\Carbon $created_at 
 * @property \Carbon\Carbon $updated_at 
 * @property string $deleted_at 
 */
class UserPaper extends Model
{
    use SoftDeletes;
    /**
     * The table associated with the model.
     *
     * @var string
     */
    protected $table = 'user_paper';
    /**
     * The attributes that are mass assignable.
     *
     * @var array
     */
    protected $fillable = [
        'user_id',
        'paper_id',
        'district_id',
        'street_id',
        'community_id',
        'full_address',
        'build_no',
        'unit_no',
        'house_no',
        'question_num',
        'mask'
    ];
    /**
     * The attributes that should be cast to native types.
     *
     * @var array
     */
    protected $casts = ['id' => 'int', 'user_id' => 'integer', 'paper_id' => 'integer', 'created_at' => 'datetime', 'updated_at' => 'datetime'];

    public function paper(){
        return $this->belongsTo(Paper::class,'paper_id','id');
    }
}